package com.zh.springcloud.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: Direct 配置类
 * @ClassName DirectRabbitConfig
 * @date: 2021.08.20 10:22
 * @Author: zhanghang
 */
@Configuration
public class FanoutRabbitConfig {

	public static String EXCHANGE_NAME = "test-fanout-exchange";



	/**
	 * Direct 交换机
	 * @return
	 */
	@Bean
	public FanoutExchange createFanoutExchange(){
		// 参数说明： public DirectExchange(String name, boolean durable, boolean autoDelete){}
		// name:    交换机名称
		// durable： 是否持久化
		// autoDelete： 是否自动删除
		return new FanoutExchange(EXCHANGE_NAME,true,false);
	}

}
